package com.kgc.smbms.service.impl;

import com.kgc.smbms.entity.Provider;
import com.kgc.smbms.mapper.ProviderMapper;
import com.kgc.smbms.service.ProviderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("providerService")
public class ProviderServiceImpl implements ProviderService {
    @Resource
    private ProviderMapper providerMapper;
    @Override
    /**
     * 查询所有供应商
     */
    public List<Provider> getAll() {
        List<Provider> providerList = providerMapper.selectAll();
        return providerList;
    }
    /**
     * 根据查询供应商
     */
    @Override
    public List<Provider> getProviderByCondition(String proName) {
        Provider provider = new Provider();
        provider.setProName(proName);
        List<Provider> providerList = providerMapper.getProviderByCondition(provider);
        return providerList;
    }

    @Override
    public Provider getProviderById(int id) {
        return null;
    }

    @Override
    public boolean check(String type, String param) {
        return false;
    }

    @Override
    /**
     * 添加供应商
     */
    public boolean add(Provider provider) {
        int num = providerMapper.addProvider(provider);
        if(num>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean update(Provider provider) {
        return false;
    }

    @Override
    public boolean delete(int id) {
        return false;
    }
}
